<html>
  <head>
    <script type="module">
      import '../bundle.js';
    </script>
  </head>
  <body>
    <h3>
      This page is used to test **skip-cookie-check** feature for iFrame based
      LuigiContainer
    </h3>

    <div style="border: solid 1px blue; height: 400px">
      <!-- Luigi Container to test general functionality-->
      <luigi-container
        data-test-id="iframe-based-container-test"
        viewURL="./microfrontend.html"
        skip-cookie-check="true"
      ></luigi-container>
    </div>

    <script type="module">
      import Events from '../bundle.js';

      const luigiContainer = document.querySelector(
        '[data-test-id="iframe-based-container-test"]',
      );

      // SET_THIRD_PARTY_COOKIES_REQUEST - called on microfrontend startup
      luigiContainer.addEventListener(Events.SET_THIRD_PARTY_COOKIES_REQUEST, (event) => {
        console.log(Events.SET_THIRD_PARTY_COOKIES_REQUEST, event);
        alert(
          Events.SET_THIRD_PARTY_COOKIES_REQUEST,
          'message received: ' + JSON.stringify(event.detail.data.data),
        );
      });
    </script>
  </body>
</html>
